package com.lanxin.dto;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.Getter;

import java.io.Serializable;

/**
 * @author cyh
 * @create 2025-09-17 10:00
 */
@Getter
@ApiModel(value = "分页数据")
public class PageDTO implements Serializable {

    @ApiModelProperty(value = "当前页码",required = true)
    private Integer page;
    @ApiModelProperty(value = "每页显示条数",required = true)
    private Integer pageSize;

    public void setPage(Integer page) {
        this.page = page;
        if (page < 1) {
            this.page = 1;
        }
    }

    public void setPageSize(Integer pageSize) {
        this.pageSize = pageSize;
        if(pageSize < 1){
            this.pageSize = 10;
        }
    }
}
